TextShape TransformationMatrix
Gets or sets the transform matrix used to transform the text shape.
public Matrix TransformationMatrix {get;Set} |
Return value
Matrix | The transformation matrix |
Example
Copy
DistanceUnit drillUnits = DistanceUnit.Millimeters;
scanDocument = scanDeviceManager.CreateScanDocument(GetselectedDeviceUniqueName(), DistanceUnit.Millimeters, false);
if (scanDocument != null)
{
VectorImage vectorImage = scanDocument.CreateVectorImage("image1", drillUnits);
vectorImage.SetMarkSpeed(1000);
vectorImage.SetJumpSpeed(2000);
vectorImage.SetJumpDelay(100);
vectorImage.SetMarkDelay(100);
//Set Laser Delays
vectorImage.SetLaserOnDelay(10);
vectorImage.SetLaserOffDelay(10);
TextShape textShape = new TextShape();
textShape.AddText("Sample text", "Arial", FontStyle.Regular, 10f, 1f);
textShape.TextBoxHeight = 20;
textShape.TextBoxWidth = 60;
textShape.DotDurationMicroseconds = 2;
textShape.HorizontalAlign = TextHorizontalAlign.Left;
textShape.VerticalAlign = TextVerticalAlign.Center;
textShape.WordWrap = true;
textShape.LineSpaceStyle = TextLineSpaceStyle.Factor;
textShape.LineSpace = 1f;
textShape.AddHatchPatternLine(0.2f, HatchLineBorderGapDirection.Inward, 0.12f, 0, 0, 0, HatchLineStyle.Unidirectional, true,
HatchOffsetAlgorithm.DirectOffset, HatchCornerStyle.SmoothWithArcs);
Matrix transformationMatrix = new Matrix(1, 1, 0, 1, 1, 0);
textShape.TransformationMatrix = transformationMatrix;
vectorImage.AddText(textShape);
scanDocument.Scripts.Add(new ScanningScriptChunk("defaultScript", "ScanAll()"));
try
{
scanDocument.StartScanning();
}
catch
{
}
}